<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>添加部门</title>
        <style type="text/css">
            .form-row {
                overflow: hidden ;
                margin: 15px ;
                border: 1px solid blue ;
            }

            .form-row>span {
                float: left;
                height: 50px ;
                line-height: 50px ;
            }
        </style>
    </head>
    <body class="dept-add">

        {% macro row( deptName , fieldType = 'text' , fieldName ) %}
        <div class="form-row">
            <span>{{deptName}}</span>
            <span>
                <input type="{{fieldType}}" name="{{fieldName}}" placeholder="{{deptName}}" >
            </span>
        </div>
        {% endmacro %}

        <form action="/dept/add" method="post">
            {{ row( '部门名称' , fieldName = 'name' ) }}
            {{ row( '所在地区' , fieldName = 'location' ) }}
            <button type="submit">添加</button>
        </form>
        
    </body>
</html>